/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scsgtbroles")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scsgtbroles.findAll", query = "SELECT s FROM Scsgtbroles s"),
    @NamedQuery(name = "Scsgtbroles.findByScsgtbrolesid", query = "SELECT s FROM Scsgtbroles s WHERE s.scsgtbrolesid = :scsgtbrolesid"),
    @NamedQuery(name = "Scsgtbroles.findByNombre", query = "SELECT s FROM Scsgtbroles s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Scsgtbroles.findByMostrar", query = "SELECT s FROM Scsgtbroles s WHERE s.mostrar = :mostrar"),
    @NamedQuery(name = "Scsgtbroles.findByObservaciones", query = "SELECT s FROM Scsgtbroles s WHERE s.observaciones = :observaciones")})
public class Scsgtbroles implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scsgtbrolesid")
    private Integer scsgtbrolesid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mostrar")
    private boolean mostrar;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scsgtbrolesid")
    private Collection<Scsgtbusurol> scsgtbusurolCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scsgtbrolesid")
    private Collection<Scsgtbarchusu> scsgtbarchusuCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scsgtbrolesid")
    private Collection<Scsgtbarchrol> scsgtbarchrolCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scsgtbrolesid")
    private Collection<Scactbnotienv> scactbnotienvCollection;

    public Scsgtbroles() {
    }

    public Scsgtbroles(Integer scsgtbrolesid) {
        this.scsgtbrolesid = scsgtbrolesid;
    }

    public Scsgtbroles(Integer scsgtbrolesid, String nombre, boolean mostrar, String observaciones) {
        this.scsgtbrolesid = scsgtbrolesid;
        this.nombre = nombre;
        this.mostrar = mostrar;
        this.observaciones = observaciones;
    }

    public Integer getScsgtbrolesid() {
        return scsgtbrolesid;
    }

    public void setScsgtbrolesid(Integer scsgtbrolesid) {
        this.scsgtbrolesid = scsgtbrolesid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public boolean getMostrar() {
        return mostrar;
    }

    public void setMostrar(boolean mostrar) {
        this.mostrar = mostrar;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Scsgtbusurol> getScsgtbusurolCollection() {
        return scsgtbusurolCollection;
    }

    public void setScsgtbusurolCollection(Collection<Scsgtbusurol> scsgtbusurolCollection) {
        this.scsgtbusurolCollection = scsgtbusurolCollection;
    }

    @XmlTransient
    public Collection<Scsgtbarchusu> getScsgtbarchusuCollection() {
        return scsgtbarchusuCollection;
    }

    public void setScsgtbarchusuCollection(Collection<Scsgtbarchusu> scsgtbarchusuCollection) {
        this.scsgtbarchusuCollection = scsgtbarchusuCollection;
    }

    @XmlTransient
    public Collection<Scsgtbarchrol> getScsgtbarchrolCollection() {
        return scsgtbarchrolCollection;
    }

    public void setScsgtbarchrolCollection(Collection<Scsgtbarchrol> scsgtbarchrolCollection) {
        this.scsgtbarchrolCollection = scsgtbarchrolCollection;
    }

    @XmlTransient
    public Collection<Scactbnotienv> getScactbnotienvCollection() {
        return scactbnotienvCollection;
    }

    public void setScactbnotienvCollection(Collection<Scactbnotienv> scactbnotienvCollection) {
        this.scactbnotienvCollection = scactbnotienvCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scsgtbrolesid != null ? scsgtbrolesid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scsgtbroles)) {
            return false;
        }
        Scsgtbroles other = (Scsgtbroles) object;
        if ((this.scsgtbrolesid == null && other.scsgtbrolesid != null) || (this.scsgtbrolesid != null && !this.scsgtbrolesid.equals(other.scsgtbrolesid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scsgtbroles[ scsgtbrolesid=" + scsgtbrolesid + " ]";
    }
    
}
